package model

type Order struct {
	Id             uint64          `gorm:"type:bigint unsigned;primary_key;comment:主键"`
	UserId         uint64          `gorm:"column:user_id;type:bigint unsigned;not null;comment:用户id"`
	OrderNo        string          `gorm:"column:order_no;type:varchar(50);not null;comment:订单编号"`
	Status         int64           `gorm:"column:status;type:int unsigned;not null;comment:订单状态，未付款,已付款,已发货,已签收,退货申请,退货中,已退货,取消交易"`
	GoodsCount     int64           `gorm:"column:goods_count;type:int unsigned;not null;comment:商品项数量，一个订单有多件商品"`
	GoodsAmount    float64         `gorm:"column:goods_amount;type:double unsigned;not null;comment:商品总价"`
	OrderAmount    float64         `gorm:"column:order_amount;type:double unsigned;not null;comment:实际付款金额"`
	LogisticsFee   float64         `gorm:"column:logistics_fee;type:double unsigned;not null;comment:运费金额"`
	OrderGoodsSkus []OrderGoodsSku `gorm:"foreignKey:OrderId"`
	Model
}

type OrderGoodsSku struct {
	Id         uint64 `gorm:"type:bigint unsigned;primary_key;comment:主键"`
	OrderId    uint64 `gorm:"column:order_id;type:bigint unsigned;not null;comment:订单id"`
	GoodsSkuId uint64 `gorm:"column:goods_sku_id;type:bigint unsigned;not null;comment:商品id"`
	Count      int64  `gorm:"column:count;type:int unsigned;not null;comment:商品数量"`
	Model
}
